<term>updates</term>
<listitem><para>Visual feedback about window updates</para></listitem>
</varlistentry>
+ <varlistentry>
+ <term>resize</term>
+ <listitem><para>Highlight resizing widgets</para></listitem>
+ </varlistentry>
</variablelist>
The special value <literal>all</literal> can be used to turn on all
GTK_DEBUG_NO_PIXEL_CACHE = 1 << 16,
GTK_DEBUG_INTERACTIVE = 1 << 17,
GTK_DEBUG_TOUCHSCREEN = 1 << 18,
- GTK_DEBUG_ACTIONS = 1 << 19
+ GTK_DEBUG_ACTIONS = 1 << 19,
+ GTK_DEBUG_RESIZE = 1 << 20
} GtkDebugFlag;
#ifdef G_ENABLE_DEBUG
{"interactive", GTK_DEBUG_INTERACTIVE},
{"touchscreen", GTK_DEBUG_TOUCHSCREEN},
{"actions", GTK_DEBUG_ACTIONS},
+ {"resize", GTK_DEBUG_RESIZE}
};
#endif /* G_ENABLE_DEBUG */
priv->alloc_needed = TRUE;
priv->alloc_needed_on_child = TRUE;
priv->focus_on_click = TRUE;
+#ifdef G_ENABLE_DEBUG
+ priv->highlight_resize = FALSE;
+#endif
switch (_gtk_widget_get_direction (widget))
{
gtk_widget_push_verify_invariants (widget);
#ifdef G_ENABLE_DEBUG
+ priv->highlight_resize = TRUE;
+ gtk_widget_queue_draw (widget);
+
if (gtk_widget_get_resize_needed (widget))
{
g_warning ("Allocating size to %s %p without calling gtk_widget_get_preferred_width/height(). "
cairo_restore (cr);
}
}
+
+ if (GTK_DEBUG_CHECK (RESIZE) &&
+ widget->priv->highlight_resize)
+ {
+ GtkAllocation alloc;
+ gtk_widget_get_allocation (widget, &alloc);
+
+ cairo_rectangle (cr, 0, 0, alloc.width, alloc.height);
+ cairo_set_source_rgba (cr, 1, 0, 0, 0.2);
+ cairo_fill (cr);
+
+ gtk_widget_queue_draw (widget);
+
+ widget->priv->highlight_resize = FALSE;
+
+ }
#endif
if (cairo_status (cr) &&
guint direction : 2;
+#ifdef G_ENABLE_DEBUG
+ guint highlight_resize : 1;
+#endif
+
guint in_destruction : 1;
guint toplevel : 1;
guint anchored : 1;
redraw_everything ();
}
+static void
+widget_resize_activate (GtkSwitch *sw)
+{
+ guint flags = gtk_get_debug_flags ();
+
+ if (gtk_switch_get_active (sw))
+ flags |= GTK_DEBUG_RESIZE;
+ else
+ flags &= ~GTK_DEBUG_RESIZE;
+
+ gtk_set_debug_flags (flags);
+}
+
static void
fill_gtk (const gchar *path,
GHashTable *t)
gtk_widget_class_bind_template_callback (widget_class, rendering_mode_changed);
gtk_widget_class_bind_template_callback (widget_class, baselines_activate);
gtk_widget_class_bind_template_callback (widget_class, pixelcache_activate);
+ gtk_widget_class_bind_template_callback (widget_class, widget_resize_activate);
gtk_widget_class_bind_template_callback (widget_class, software_gl_activate);
gtk_widget_class_bind_template_callback (widget_class, software_surface_activate);
gtk_widget_class_bind_template_callback (widget_class, texture_rectangle_activate);
</child>
</object>
</child>
+ <child>
+ <object class="GtkListBoxRow">
+ <property name="visible">True</property>
+ <property name="activatable">False</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="margin">10</property>
+ <property name="spacing">40</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Show Widget Resizes</property>
+ <property name="halign">start</property>
+ <property name="valign">baseline</property>
+ <property name="xalign">0.0</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkSwitch" id="widget_resize_switch">
+ <property name="visible">True</property>
+ <property name="halign">end</property>
+ <property name="valign">baseline</property>
+ <signal name="notify::active" handler="widget_resize_activate"/>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
<child>
<object class="GtkListBoxRow">
<property name="visible">True</property>